//
//  RxSwift+UIKit.swift
//  XXSync
//
//  Created by Rdxer on 2017/8/14.
//  Copyright © 2017年 Rdxer. All rights reserved.
//

import UIKit
import RxSwift
import RxCocoa

extension Reactive where Base: UIResponder {
    public func isFirstResponder(isInvert:Bool = false)-> Binder<Bool> {
        return Binder(self.base) { responder, value in
            if isInvert ? !value : value {
                responder.becomeFirstResponder()
            }else{
                responder.resignFirstResponder()
            }
        }
    }
}

//
//extension Reactive where Base: UIView {
//    /// Bindable sink for `hidden` property.
//    public var isHidden: Binder<Bool> {
//        return Binder(self.base) { view, hidden in
//            view.isHidden = hidden
//        }
//    }
//
//    /// Bindable sink for `alpha` property.
//    public var alpha: Binder<CGFloat> {
//        return Binder(self.base) { view, alpha in
//            view.alpha = alpha
//        }
//    }
//
//    /// Bindable sink for `isUserInteractionEnabled` property.
//    public var isUserInteractionEnabled: Binder<Bool> {
//        return Binder(self.base) { view, userInteractionEnabled in
//            view.isUserInteractionEnabled = userInteractionEnabled
//        }
//    }
//
//}

